package br.com.felipe.agendamento.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.felipe.agendamento.dao.EnderecoDao;
import br.com.felipe.agendamento.entity.EnderecoDto;

@Service(value="enderecoServiceFacade")
public class EnderecoServiceFacadeImpl implements EnderecoServiceFacade {

	@Autowired
	private EnderecoDao enderecoDao;
	
	@Override
	public void cadastrarEndereco(EnderecoDto e) {
		enderecoDao.adicionar(e);
	}

	public void setEnderecoDao(EnderecoDao enderecoDao) {
		this.enderecoDao = enderecoDao;
	}

	@Override
	public List<EnderecoDto> getListaTodosEnderecos() {
		return enderecoDao.lista();
	}

	@Override
	public EnderecoDto getEnderecoPeloId(Integer id) {
		return enderecoDao.buscaPorId(id);
	}

	@Override
	public void deletarEndereco(Integer id) {
		enderecoDao.remover(id);
	}

	@Override
	public void deletarEndereco(EnderecoDto e) {
		enderecoDao.remover(e);
	}

}
